<template>
    <div class="component-container">
        <div class="select-container" v-for="item in components" :key="item.type">
            <button @click="hanlderClick(item.type)">{{item.name}}</button>
        </div>
            <hr>
    </div>
</template>

<script>
export default {
    name: 'home',
    data() {
        return {
            components: [
                {
                    type: 'button',
                    name: '按钮'
                },
                {
                    type: 'input',
                    name: '输入框'
                }
            ]
        }
    },
    methods: {
        hanlderClick(path) {
            this.$router.push({path: path})
        }
    }
}
</script>

<style lang="scss" scoped>
.component-container{
    // background-color: #999;

    .select-container{
        // background-color: red
    }
}
</style>